package com.api.Impl;


import com.Enum.LoggerEnum;
import com.api.LogHandler;

public class ErrorLogHandler implements LogHandler {
    @Override
    public void handleLog(LoggerEnum logLevel, String message, LogHandler nextHandler) {
        if (logLevel.shouldLog(LoggerEnum.ERROR)) {
            System.out.println(this.getClass().getSimpleName() + ">> ERROR: " + message);
        }
        // 如果存在下一个处理器
        if (nextHandler != null) {
            nextHandler.handleLog(logLevel, message, nextHandler);
        }
    }
}